package com.wc.alorithm_luogu.P5710;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/18 9:38
 * @description https://www.luogu.com.cn/problem/P5710
 * 数的性质
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int x = sc.nextInt();

        boolean flg1 = false;
        boolean flg2 = false;

        flg1 = x % 2 == 0;
        flg2 = x > 4 && x <= 12;

        StringBuffer stringBuffer = new StringBuffer();

        if (flg1 && flg2) {
            stringBuffer.append(1);
        } else {
            stringBuffer.append(0);
        }
        stringBuffer.append(' ');
        if (flg1 || flg2) {
            stringBuffer.append(1);
        } else {
            stringBuffer.append(0);
        }
        stringBuffer.append(' ');
        if (flg1 && !flg2 || !flg1 && flg2) {
            stringBuffer.append(1);
        } else {
            stringBuffer.append(0);
        }

        stringBuffer.append(' ');
        if (!(flg1 || flg2)) {
            stringBuffer.append(1);
        } else {
            stringBuffer.append(0);
        }
        System.out.println(stringBuffer);
    }
}
